<template>
    
    
    <!-- <div id="index" ref="appRef" class="index_home" :class="{ pageisScale: true }"> -->
         <!-- <div id="index" ref="appRef" class="index_home" :class="{ pageisScale: isScale }"> -->
  <!--  <ScaleScreen>这是一个响应式屏幕组件，可以根据不同的屏幕大小进行缩放。它的宽度和高度被设置为1920和1080，这是大屏显示的常见分辨率。-->
  <ScaleScreen
    :width="1920"
    :height="1080"
    class="scale-wrap"
    :selfAdaption="$store.state.setting.isScale"
  >
        <div class="bg">
            <dv-loading v-if="loading">Loading...</dv-loading>
            <div v-else class="host-body">
                <!-- 头部 s -->
                <div class="d-flex jc-center title_wrap">
                    <div class="zuojuxing"></div>
                    <div class="youjuxing"></div>
                    <div class="guang"></div>
                    <div class="d-flex jc-center">
                        <div class="title">
                            <span class="title-text">灵科智达物联网平台</span>
                        </div>
                    </div>
                    <div class="timers ">
                        {{ dateYear }} {{ dateWeek }} {{ dateDay }}
                        <!-- <i class=" blq-icon-shezhi02" style="margin-left:10px" @click="showSetting"></i> -->
                    </div>
                </div>
                <!-- 头部 e-->
                <!-- 内容  s-->
                <index></index>
                <!-- 内容 e -->
            </div>
        </div>
        <Setting ref="setting" />
    </ScaleScreen>
    <!-- </div> -->


</template>

<script>
// import drawMixin from "../utils/drawMixin";
import {
    formatTime
} from "../utils/index.js";
import Setting from './setting.vue'
import ScaleScreen from "@/components/scale-screen/scale-screen.vue";
import index from './indexs/index.vue'
export default {
    // mixins: [drawMixin],
    components: {
        Setting,
        ScaleScreen,
        index
    },
    data() {
        return {
            timing: null,
            loading: true,
            dateDay: null,
            dateYear: null,
            dateWeek: null,
            weekday: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
        };
    },
    filters: {
        numsFilter(msg) {
            return msg || 0;
        },
    },
    computed: {

    },
    created() {
    },
    mounted() {

        this.timeFn();
        this.cancelLoading();

    },
    beforeDestroy() {
        clearInterval(this.timing);
    },
    methods: {
        showSetting() {
            this.$refs.setting.init()
        },
        timeFn() {
            this.timing = setInterval(() => {
                this.dateDay = formatTime(new Date(), "HH: mm: ss");
                this.dateYear = formatTime(new Date(), "yyyy-MM-dd");
                this.dateWeek = this.weekday[new Date().getDay()];
            }, 1000);
        },
        cancelLoading() {
            setTimeout(() => {
                this.loading = false;
            }, 500);
        },
    },
};
</script>

<style lang="scss">
@import "./home.scss";
</style>
